package com.wujunshen.designpattern.creational.simplefactory;

import com.wujunshen.designpattern.creational.simplefactory.nofactory.BrandOne;
import com.wujunshen.designpattern.creational.simplefactory.nofactory.BrandTwo;

import static com.wujunshen.designpattern.creational.simplefactory.Constants.BRAND_ONE;
import static com.wujunshen.designpattern.creational.simplefactory.Constants.BRAND_TWO;

/**
 * @author frank woo(吴峻申) <br>
 *     email:<a href="mailto:frank_wjs@hotmail.com">frank_wjs@hotmail.com</a> <br>
 * @date 2021/2/16 23:42<br>
 */
public class SimpleFactory {
  public static IVehicle createProduct(int brandCode) {
    switch (brandCode) {
      case BRAND_ONE:
        return new BrandOne();
      case BRAND_TWO:
        return new BrandTwo();
      default:
        return null;
    }
  }
}
